package com.qsl.ssyx.product.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qsl.ssyx.product.mapper.AttrMapper;
import com.qsl.ssyx.model.product.Attr;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qsl.ssyx.product.service.AttrService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 商品属性 服务实现类
 * </p>
 *
 * @author 青衫泪
 * @since 2023-08-10
 */
@Service
public class AttrServiceImpl extends ServiceImpl<AttrMapper, Attr> implements AttrService {


    //    条件分页查询
    @Override
    public List<Attr> getAttrByGroupId(Integer groupId) {
        LambdaQueryWrapper<Attr> lqw = new LambdaQueryWrapper<>();
        lqw.eq(Attr::getAttrGroupId, groupId);
        List<Attr> attrList = baseMapper.selectList(lqw);
        return attrList;
    }
}
